﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MvcApplication6.Models;
using MvcApplication6.BIZ;

namespace MvcApplication6.Controllers
{
    public class ImageController : Controller
    {
        //
        // GET: /Image/
        AdminImage adminImage = new AdminImage();
        ImageBIZ iBiz = new ImageBIZ();
        public ActionResult Index()
        {
            adminImage.listImage = iBiz.ImagePaging(1);
            adminImage.count = iBiz.ImageCountPaging();
            adminImage.pageIndex = 1;
            return View(adminImage);
        }

        public ActionResult PagingImage(int pageIndex)
        {
            adminImage.listImage = iBiz.ImagePaging(pageIndex);
            adminImage.count = iBiz.ImageCountPaging();
            adminImage.pageIndex = pageIndex;
            return PartialView("_PagingImage", adminImage);
        }

    }
}
